From: Ævar Arnfjörð Bjarmason Date: Tue, 18 Oct 2005 13:28:21 +0000 (+0000) Subject: * Don't display nlinks by default when being included but allow them to be displayed... X-Git-Tag: 1.6.0~1399 X-Git-Url: http://git.cyclocoop.org/%22.%24info%5B?a=commitdiff_plain;h=5a64ba85951ff49561c7e4c8178c96addd57cf80;p=lhc%2Fweb%2Fwiklou.git * Don't display nlinks by default when being included but allow them to be displayed optionally --- diff --git a/includes/SpecialWantedpages.php b/includes/SpecialWantedpages.php index 428e3e94b5..bccd6e41a4 100644 --- a/includes/SpecialWantedpages.php +++ b/includes/SpecialWantedpages.php @@ -16,8 +16,11 @@ require_once 'QueryPage.php'; * @subpackage SpecialPage */ class WantedPagesPage extends QueryPage { - function WantedPagesPage( $inc = false ) { + var $nlinks; + + function WantedPagesPage( $inc = false, $nlinks = true ) { $this->setListoutput( $inc ); + $this->nlinks = $nlinks; } function getName() { @@ -76,7 +79,7 @@ class WantedPagesPage extends QueryPage { $nl = wfMsg( 'nlinks', $result->value ); $nlink = $skin->makeKnownLink( $wgContLang->specialPage( 'Whatlinkshere' ), $nl, 'target=' . $nt->getPrefixedURL() ); - return "$plink ($nlink)"; + return $this->nlinks ? "$plink ($nlink)" : $plink; } } @@ -87,12 +90,16 @@ function wfSpecialWantedpages( $par = null, $specialPage ) { $inc = $specialPage->including(); if ( $inc ) { - $limit = (int)$par; + @list( $limit, $nlinks ) = explode( '/', $par, 2 ); + $limit = (int)$limit; + $nlinks = $nlinks === 'nlinks'; $offset = 0; - } else + } else { list( $limit, $offset ) = wfCheckLimits(); + $nlinks = true; + } - $wpp = new WantedPagesPage( $inc ); + $wpp = new WantedPagesPage( $inc, $nlinks ); $wpp->doQuery( $offset, $limit, !$inc ); }